package com.share.demo.jvm;

import lombok.Getter;
import lombok.Setter;

/**
 * author:caifan
 * date:2019/10/4
 */
public class StackOverflowSOP {
    private int stackLength = 1;

    public void stackLeak() {
        stackLength++;
        stackLeak();
    }

    public static void main(String[] args) {
        StackOverflowSOP overflowSOP = new StackOverflowSOP();
        try {
            overflowSOP.stackLeak();
        } catch (Throwable e) {
            System.out.println(overflowSOP.stackLength);
            e.printStackTrace();
        }
    }
}
